import request from '@/utils/request'
export const getEmployeeSimple = () => request({
  url: '/sys/user/simple'
})

// 获取员工列表
export const getEmployeeList = params => request({
  url: '/sys/user',
  params
})

// 删除员工
export const delEE = id => request({
  url: `/sys/user/${id}`,
  method: 'delete'
})

// 新增员工
export const addEE = data => request({
  url: '/sys/user',
  method: 'post',
  data
})

// excel导入员工列表
export const importEE = data => request({
  url: '/sys/user/batch',
  method: 'POST',
  data
})

// 更新员工信息
export const updateInfo = data => request({
  url: `/sys/user/${data.id}`,
  method: 'put',
  data
})

// 获取员工个人详细信息
export const getPersonalInfo = id => request({
  url: `/employees/${id}/personalInfo`
})

/** *
 *  更新用户详情的基础信息
 * **/
export const updatePersonal = data => request({
  method: 'put',
  url: `/employees/${data.id}/personalInfo`,
  data
})

/** **
 * 获取用户的岗位信息
 *
 * ****/
export const getJobDetail = id => request({
  url: `/employees/${id}/jobs`
})

/**
 * 保存岗位信息
 * ****/
export const updateJob = data => request({
  url: `/employees/${data.userId}/jobs`,
  method: 'put',
  data
})
